
import { updateFloat } from "../../utils";
import { IScheduleTask } from "../node";

export class KwaiNebulaHuGuanSheduleTask implements IScheduleTask {
    time: number = 1000 * 60;
    title: string = `【快手极速互关】`;
    isRuning: boolean = false;
    check(): boolean {
        return true;
    }
    start(): void {
        if (this.isRuning) {
            updateFloat({ toast: `${this.title}已经执行` })
            return;
        }
        this.isRuning = true;
        updateFloat({ toast: `正在执行${this.title}任务`, currentTask: this.title })
        while (this.isRuning) {
            sleep(1000 * 10)
        }
    }
    stop(): void {
        this.isRuning = false;
        updateFloat({ toast: `${this.title}任务执行结束`, currentTask: this.title })
    }
}